//
// Created by 谢哲 on 2021/5/8.
//

#include <iostream>
#include <algorithm>
using namespace std;

int main() {
    unsigned long long n, m;
    cin >> n >> m;

    unsigned long long square_ans = 0, rect_ans = 0;
    for (unsigned long long i=1; i<=min(m, n); ++i) {
        square_ans += (m-i+1ull) * (n-i+1ull);
    }
    for (unsigned long long i=0; i<n; ++i) {
        for (unsigned long long j=0; j<m; ++j) {
            rect_ans += (n-i) * (m-j);
        }
    }
    rect_ans -= square_ans;

    cout << square_ans << " " << rect_ans;

    return 0;
}
